#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include"Stack.h"

int main(int argc, char const* argv[])
{
    struct Stack s;
    if (Init_Stack(&s, 5) == true)
    {
        int num = 0;
        printf("input num:");
        scanf("%d", &num);

        int n = 0;
        printf("input n:");
        scanf("%d", &n);

        if (n == 16)
        {
            printf("0x");
        }
        while (num != 0)
        {
            int temp = num % n;
            if (temp <= 9)
            {
                temp = temp + '0';
            }
            else
            {
                temp = temp - 10 + 'A';
            }
            Push(&s, temp);
            num = num / n;
        }


        while (s.len != 0)
        {
            printf("%c", *Pop(&s));
        }
        printf("\n");
    }

    return 0;
}
